﻿using System.Xml.Linq;
using Common.Interface;
using MainProcessor.Processors;
using NUnit.Framework;

namespace Test.Main.Processors
{
    [TestFixture]
    public class EntityFactoryTests
    {
        private IEntityFactory factory;

        [SetUp]
        public void SetUp()
        {
            factory = new EntityFactory();
        }

        [Test]
        public void ShouldReturnListOfExtractedChildren()
        {
            var xml = XElement.Parse(ConstantXml.TestString);

            var children = factory.CreateChildren(xml);

            Assert.AreEqual(children.Count, 2);
            Assert.IsFalse(children[0].HasParent);
            Assert.IsFalse(children[0].IsEmpty);
            Assert.IsTrue(children[1].HasParent);
        }


                
    }
}

